]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
authPrompt: Refactor 'next' signal
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Tue, 11 Feb 2020 13:27:36 +0000 (10:27 -0300)
committerFlorian Müllner <florian.muellner@gmail.com>
Wed, 12 Feb 2020 19:29:48 +0000 (19:29 +0000)
Currently, AuthPrompt is connecting to its own 'next' signal
signal to react to any of the entries being activated, and do
some actions like starting the spinner and answering the PAM
question.

Refactor this code into another method, and don't connect to
our own signal.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/922

js/gdm/authPrompt.js

index 13c7025c3c50ecd350472b42765b0297af35a4b0..ff04af639707c222419927af31fbf3e8da77bab5 100644 (file)
@@ -73,15 +73,6 @@ var AuthPrompt = GObject.registerClass({
         this._userVerifier.connect('ovirt-user-authenticated', this._onOVirtUserAuthenticated.bind(this));
         this.smartcardDetected = this._userVerifier.smartcardDetected;
 
-        this.connect('next', () => {
-            this.updateSensitivity(false);
-            this.startSpinning();
-            if (this._queryingService)
-                this._userVerifier.answerQuery(this._queryingService, this._entry.text);
-            else
-                this._preemptiveAnswer = this._entry.text;
-        });
-
         this.connect('destroy', this._onDestroy.bind(this));
 
         this._userWell = new St.Bin({
@@ -167,7 +158,7 @@ var AuthPrompt = GObject.registerClass({
 
             entry.clutter_text.connect('activate', () => {
                 if (entry.reactive)
-                    this.emit('next');
+                    this._activateNext();
             });
         });
 
@@ -186,6 +177,17 @@ var AuthPrompt = GObject.registerClass({
         this._defaultButtonWell.add_child(this._spinner);
     }
 
+    _activateNext() {
+        this.updateSensitivity(false);
+        this.startSpinning();
+        if (this._queryingService)
+            this._userVerifier.answerQuery(this._queryingService, this._entry.text);
+        else
+            this._preemptiveAnswer = this._entry.text;
+
+        this.emit('next');
+    }
+
     _updateEntry(secret) {
         if (secret && this._entry !== this._passwordEntry) {
             this._mainBox.replace_child(this._entry, this._passwordEntry);